#ifndef _KEYBOARD_H_
#define _KEYBOARD_H_

#ifdef _WIN32
#pragma once
#endif

/**
 * 01.03.12 - Steven Hartin - Copied over from a previous project, added
 *                            comments and slighlty modified code to work with
 *                            this project.
 */

#include <vector>

#include "input.h"
#include "timer.h"

using std::vector;

#define KEYDOWN(name, key) (name[key] & 0x80)
#define DEBOUNCE_TIME 0.05

class CKeyboard : public CInputDevice
{
public:
    CKeyboard();

    void setUp(LPDIRECTINPUT8 pDirectInput, HWND hwndMain);
    void processState();

    bool keyPressed(const unsigned char charrBuffer[256], int nArrIndex) const;
    void registerKeyDebounce(int nArrIndex, const CTimer &timeDiff);
private:
    vector<CTimer> m_arrDebounceTimes;
};

#endif